<%
'--------------------------------
'Key_ShowTodayNew
'  ãʾÿƼͼϢ
'  
'--------------------------------
Sub Key_ShowTodayNew()
	Dim sql,rs
	Sql="select top 1 title,linkadd,imgadd,info from key_todaynew where id=1"
	Set rs=conn.execute(sql)
	If not rs.bof and not rs.eof then
		Title=rs(0)
		Linkadd=rs(1)
		Imgadd=rs(2)
		Info=rs(3)
		Rs.close
	End if
	Response.write "<table border=""0"" width=""384"" id=""table1"">"

	Response.write "<tr>"
	Response.write "	<td width=""132"" rowspan=""2"">"
	Response.write "	<p align=""center"">"
	Response.write "	<a target=""_blank"" href="""&linkadd&"""><img border=""0"" src="&imgadd&" width=""123"" height=""90""></a></td>"
	Response.write "	<td class=""title4"" width=""242"" height=""30""><a target=""_blank"" href="""&linkadd&""">"&left(title,17)&"</a></td></tr><tr><td width=""242"" height=""70"" valign=""top"">"&left(info,100)&"<a target=""_blank"" href="""&linkadd&""">&nbsp;ȥ>>></a></td>"
	Response.write "</tr>"
	Response.write "</table>"
	
End Sub

'--------------------------------
'Key_ShowTodayNewN
'  ãʾÿƼѡϢͼƬɶʾƼ
'  Sort Ŀ Topn , isput ,listrow ʾ ,titlezs ,issort ǷʾĿ,isidate Ƿʾʱ,isuser,Ƿʾûisread Ƿʾ
'--------------------------------
Sub Key_ShowTodayNewN(Sort,Topn,isput,listrow,titlezs,issort,isidate,isuser,isread)

	Set rs=server.createobject("adodb.recordset")
	If Sort="00" then
		sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,filepath,reads,a.Sort,b.SortName,b.Sortid,Intro from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and isPub="&ispub&" and hot=1 order by ID desc"
	Else
		sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,filepath,reads,a.Sort,b.SortName,b.Sortid,Intro from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.sort='"&sort&"' and isPub="&ispub&" and hot=1 order by ID desc"
	End IF
	rs.open sql,conn,1,1
	zs=rs.recordcount
	Str= "<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""0"" cellpadding=""0"">"
	Str=Str & "<tr>"
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"
	
	for i=1 to zs
		if isgd=1 then
			linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
		else
			linkadd="goto.asp?id="&rs("id")
		end if
	    	Str=Str & "<td class=""Td"" width="""&tdw&""">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank""><span class=""sort"">["&rs("sortname")&"]</span></a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
	    	Str=Str & "</td>"
	    if i mod listrow =0 then 
	       Str=Str & "</tr>"
	    end if
	    rs.movenext
	next
	Str=Str & "</table>"
	rs.close
	response.write Str
End sub

'--------------------------------
'Key_ShowTodayNewNNoTJ
'  ãʾÿƼѡϢͼƬɶʾƼ
'  Sort Ŀ Topn , isput ,listrow ʾ ,titlezs ,issort ǷʾĿ,isidate Ƿʾʱ,isuser,Ƿʾûisread Ƿʾpxzd ֶ
'--------------------------------
Sub Key_ShowTodayNewNNoTJ(Sort,Topn,isput,listrow,titlezs,issort,isidate,isuser,isread,pxzd)

	Set rs=server.createobject("adodb.recordset")
	If Sort="00" then
		sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,filepath,reads,a.Sort,b.SortName,b.Sortid,Intro from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and isPub="&ispub&" order by "&pxzd&" desc"
	Else
		sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,filepath,reads,a.Sort,b.SortName,b.Sortid,Intro from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.sort='"&sort&"' and isPub="&ispub&" order by "&pxzd&" desc"
	End IF
	rs.open sql,conn,1,1
	zs=rs.recordcount
	Str= "<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""0"" cellpadding=""0"">"
	Str=Str & "<tr>"
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"
	
	for i=1 to zs
		if isgd=1 then
			linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
		else
			linkadd="goto.asp?id="&rs("id")
		end if
	    	Str=Str & "<td class=""Td"" width="""&tdw&""">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank""><span class=""sort"">["&rs("sortname")&"]</span></a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
	    	Str=Str & "</td>"
	    if i mod listrow =0 then 
	       Str=Str & "</tr>"
	    end if
	    rs.movenext
	next
	Str=Str & "</table>"
	rs.close
	response.write Str
End sub


'--------------------------------
'Key_ShowZt
'  ãʾר
'  Topn ,sort 0ҳ־ǾĿ,titlezs  smzs ˵
'--------------------------------
Sub Key_ShowZt(Topn,sort,titlezs,smzs)
	If sort="00" then
		Sql="select top "&topn&" id,sortid,title,isindex,imgadd,sm,sx from key_zt where isindex=1 order by id desc"
	Else
		Sql="select top "&topn&" id,sortid,title,isindex,imgadd,sm,sx from key_zt where sortid='"&sort&"' order by id desc"
	End if
Set rs=conn.execute(sql)
i=1
Strzt=""
Do while Not rs.eof 

	Strzt= Strzt & "<div align=center>"
	Strzt= Strzt & "<table cellSpacing=""0"" cellPadding=""3"" border=""0"" id=""table153"">"
	Strzt= Strzt & "	<tr>"
	Strzt= Strzt & "		<td align=""middle"" width=""95"" height=""70"" valign=""top"" >"
	Strzt= Strzt & "		<a href='list_zt.asp?ztid="&rs("id")&"' target='_blank'><img border=""0"" src="""&rs("imgadd")&""" width=""95"" height=""75""></a></td>"
	Strzt= Strzt & "		<td width=""165"" height=""70"" valign=""top"" >"
	Strzt= Strzt & "		<table border=""0"" width=""100%"" id=""table194"" cellspacing=""0"">"
	Strzt= Strzt & "			<tr>"
	Strzt= Strzt & "				<td><b><a href='list_zt.asp?ztid="&rs("id")&"' target='_blank'>"&HTMLEncode(left(rs("Title"),titlezs))&"</a></b></td>"
	Strzt= Strzt & "			</tr>"
	Strzt= Strzt & "			<tr>"
	Strzt= Strzt & "				<td>"&left(rs("sm"),smzs)&"</td>"
	Strzt= Strzt & "			</tr>"
	Strzt= Strzt & "		</table>"
	Strzt= Strzt & "		</td>"
	if i<>topn then
		Strzt= Strzt & "	<tr>"
		Strzt= Strzt & "		<td align=""middle"" colSpan=""2"" >"
		Strzt= Strzt & "		<img height=""1"" src=""skin/default/line.gif"" width=""260""></td>"
		Strzt= Strzt & "	</tr>"
	end if
	Strzt= Strzt & "	</table>"
	Strzt= Strzt & "</div>"

i=i+1
rs.movenext
loop
rs.close
Response.write Strzt
End sub

'--------------------------------
'Key_ShowTag
'  ãʾǩ
'  Topn , listrow ʾ ,titlezs ,sort Ŀ
'--------------------------------
Sub Key_ShowTag(Topn,listrow,titlezs,sort)

	Set rs=server.createobject("adodb.recordset")
	If sort="00" then 
		sql="select top "&topn&" id,sort,XSort from Key_XSort order by hits desc"
	Else
		sql="select top "&topn&" id,sort,XSort from Key_XSort where sort='"&sort&"' order by hits desc"
	End If	
	rs.open sql,conn,1,1
	zs=Topn
	Str= "<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""0"" cellpadding=""0"">"
	Str=Str & "<tr>"
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"
	
	for i=1 to zs
	if rs.eof then exit for '޸
	    	Str=Str & "<td class=""Td"" width="""&tdw&""">"
	    	Str=Str & ""
	    	Str=Str & "<a target='_blank' class=""link2"" href=""tag.asp?xsort="&rs(2)&""">"&left(rs(2),titlezs)&"</a>"
	    	Str=Str & "</td>"
	    if i mod listrow =0 then 
	       Str=Str & "</tr>"
	    end if
	    rs.movenext
	    
	next
	Str=Str & "</table>"
	rs.close
	response.write Str
End sub


'--------------------------------
'Key_Tjweb
'  ãƼûվʾҳ
'  Topn 
'--------------------------------
Sub Key_Tjweb(topn)
	set rs=conn.execute("select top "&topn&" webname,weburl from Key_myuser where tjindex=1 order by id asc")
	i=1 
	Str=""
	do while i<=topn and not rs.eof 
	Str=Str & "<a target='_blank' class=link3 href="""&rs(1)&""">"&rs(0)&"</a>"
	rs.movenext
	i=i+1
	loop
	rs.close
	Response.write str
End sub	


'--------------------------------
'Key_ShowVipNew
'  ãʾvipûƼ
'  Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowVipNew(Topn,isput,listrow,titlezs,issort,isidate,isuser,isread,Fpxzd,Spxzd)

	Set rs=server.createobject("adodb.recordset")
	sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and isPub="&ispub&" and isvip=1 order by "&Fpxzd&" desc,"&Spxzd&" desc"
	rs.open sql,conn,1,1
	zs=rs.recordcount
	Str= "<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""0"" cellpadding=""0"">"
	Str=Str & "<tr>"
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"
	
	for i=1 to zs
		if isgd=1 then
			linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
		else
			linkadd="goto.asp?id="&rs("id")
		end if
	    	Str=Str & "<td width="""&tdw&""">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank""><span class=""sort"">["&rs("sortname")&"]</span></a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
	    	Str=Str & "</td>"
	    if i mod listrow =0 then 
	       Str=Str & "</tr>"
	    end if
	    rs.movenext
	next
	Str=Str & "</table>"
	rs.close
	response.write Str
End sub

'--------------------------------
'Key_ShowSortNew
'  ãʾĿ,һĿҲǶĿҳ
'  sortһĿIDsortclass Ŀid Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,
'        isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowSortNew(Sort,Sortclass,Topn,isput,listrow,Tdbg,titlezs,issort,isidate,isuser,isread,Fpxzd,Spxzd)

	If Sort="" and Sortclass="" then 
		Sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and isPub="&ispub&" order by "&Fpxzd&" desc,"&Spxzd&" desc"
	Else
		If Sortclass="" then
			Sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.Sort='"&sort&"' and isPub="&ispub&" order by "&Fpxzd&" desc,"&Spxzd&" desc"
		Else
			Sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.Sortclass='"&sortclass&"' and isPub="&ispub&" order by "&Fpxzd&" desc,"&Spxzd&" desc"
		End If
	End if
	Set rs=server.createobject("adodb.recordset")
	
	rs.open sql,conn,1,1
	zs=rs.recordcount
	Str= "<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""1"" cellpadding=""1"">"
	Str=Str & "<tr>"
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"
	
	for i=1 to zs
		if isgd=1 then
			linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
		else
			linkadd="goto.asp?id="&rs("id")
		end if
	    	Str=Str & "<td bgcolor="""&Tdbg&""" width="""&tdw&""">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank""><span class=""sort"">["&rs("sortname")&"]</span></a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
	    	Str=Str & "</td>"
	    if i mod listrow =0 then 
	       Str=Str & "</tr>"
	    end if
	    rs.movenext
	next
	Str=Str & "</table>"
	rs.close
	response.write Str
End sub


'--------------------------------
'Key_ShowSortIMgNew
'  ãʾĿ,һĿҲǶĿҳ
'  sortһĿIDsortclass Ŀid Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,
'        isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowSortIMgNew(Sort,Sortclass,Topn,isput,listrow,Tdbg,titlezs,Fpxzd,Spxzd)

	If Sort="" and Sortclass="" then exit sub
	If Sortclass="" then
		Sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,img,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.Sort='"&sort&"' and isPub="&ispub&" and img<>'' order by "&Fpxzd&" desc,"&Spxzd&" desc"
	Else
		Sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,img,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.Sortclass='"&sortclass&"' and isPub="&ispub&" and img<>'' order by "&Fpxzd&" desc,"&Spxzd&" desc"
	End If
	Set rs=server.createobject("adodb.recordset")

	rs.open sql,conn,1,1
	zs=rs.recordcount
	Str= "<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""1"" cellpadding=""1"">"
	Str=Str & "<tr>"
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"
	
	for i=1 to zs
		if isgd=1 then
			linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
		else
			linkadd="goto.asp?id="&rs("id")
		end if
	    	Str=Str & "<td bgcolor="""&Tdbg&""" width="""&tdw&""" valign=""top"">"
		    	Str=Str & "<div align=""center"">"
		    	Str=Str & "<table border=""1"" width=""132"" cellspacing=""0"" cellpadding=""0"" style=""border-style: solid; border-width: 0"" height=""84"" bordercolor=""#C3D0D7"" id=""table149"">"
		    	Str=Str & "<tr>"
		    	Str=Str & "<td bgcolor=""#FFFFFF"">"
				Str=Str & "<p align=""center"">"							
				Str=Str & "<a title="""&HTMLEncode(rs("Title"))&""" target=""_blank"" href="""&linkadd&""">"
				Str=Str & "<img src="""&rs("img")&""" border=""0"" width=""130"" height=""90"" vspace=4 hspace=4></a></td>"									
				Str=Str & "</tr>"										
				Str=Str & "</table></div>"		
												
				Str=Str & "<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" id=""table153"">"											
				Str=Str & "<tr>"								
				Str=Str & "<td height=""25"" valign=""bottom"">"							
				Str=Str & "<p align=""center"">"										
				Str=Str & "<a target=""_blank"" href="""&linkadd&""">"									
				Str=Str & left(rs("title"),titlezs)								
				Str=Str & "</a></td>"						
				Str=Str & "</tr></table>"							
	    	Str=Str & "</td>"
	    if i mod listrow =0 then 
	       Str=Str & "</tr>"
	    end if
	    rs.movenext
	next
	Str=Str & "</table>"
	rs.close
	response.write Str
End sub

'--------------------------------
'Key_ShowLink
'  ãʾ
'  topn ʾ sortid Ŀ
'--------------------------------
Sub Key_ShowLink(topn,sortid)

	IF Sortid="00" then
		set rs=conn.execute("select top "&topn&" id,title,wz,titlecolor,bz from Key_link where istjindex=1 order by id desc")
	Else
		set rs=conn.execute("select top "&topn&" id,title,wz,titlecolor,bz from Key_link where sortid='"&sortid&"' order by id desc")
	End if
	Str=""
	do while not rs.eof
	Str=Str & "<a target=""_blank"" href="""&rs("wz")&""" title="""&rs("bz")&"""><font color ="""&rs("titlecolor")&""">"&rs("title")&"</font></a>&nbsp;"
	rs.movenext
	loop
	rs.close
	set rs=nothing
	Response.write str
End Sub


'--------------------------------
'Key_ShowLianmeng
'  ãʾ
'  topn ʾ sortid Ŀ
'--------------------------------
Sub Key_ShowLianmeng(topn,sortid)

	IF Sortid="00" then
		set rs=conn.execute("select top "&topn&" id,title,wz,titlecolor,bz from key_lianmeng where istjindex=1 order by id desc")
	Else
		set rs=conn.execute("select top "&topn&" id,title,wz,titlecolor,bz from Key_lianmeng where sortid='"&sortid&"' order by id desc")
	End if
	Str=""
	do while not rs.eof
	Str=Str & "<a target=""_blank"" href="""&rs("wz")&""" title="""&rs("bz")&"""><font color ="""&rs("titlecolor")&""">"&rs("title")&"</font></a>&nbsp;"
	rs.movenext
	loop
	rs.close
	set rs=nothing
	Response.write str
End Sub

'--------------------------------
'Key_ShowVisit
'  ãʾУС
'  sortһĿIDTopn , connbz,tdbg Ԫ񱳾,titlezs ,sj,ʱ
'--------------------------------
Sub Key_ShowVisit(Sort,Topn,connbz,Tdbg,titlezs,sj)


		Msg="<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""1"" cellpadding=""1"">"


		If Sort="00" then
		
				if connbz=1 then
				sql="SELECT top "&Topn&" ZhaiID FROM Key_visit WHERE len(zhaiid)>1 and (NOW() - VisitTime <= "&sj&") GROUP BY ZhaiID ORDER BY COUNT(zhaiid) DESC"
				else
				sql="SELECT top "&Topn&" ZhaiID FROM Key_visit WHERE zhaiid<>'' and ({ fn NOW() } - VisitTime <= "&sj&") GROUP BY ZhaiID ORDER BY COUNT(*) DESC"
				end if
		Else
				if connbz=1 then
				sql="SELECT top "&Topn&" ZhaiID FROM key_visit WHERE len(zhaiid)>1 and sort='"&sort&"' and (NOW() - VisitTime <= "&sj&") GROUP BY ZhaiID ORDER BY COUNT(zhaiid) DESC"
				else
				sql="SELECT top "&Topn&" ZhaiID FROM key_visit WHERE zhaiid<>'' and sort='"&sort&"' and ({ fn NOW() } - VisitTime <= "&sj&") GROUP BY ZhaiID ORDER BY COUNT(*) DESC"
				end if

		End if
				set rsv=conn.execute(sql)
				
				i=1
				do while not rsv.eof and i<=topn
					sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,filepath from Key_zhai where ID="&rsv("zhaiid")
					set rszhai=conn.execute(sql)
					if not rszhai.eof then
						msg=msg&"<tr height='20'>"
						if isgd=1 then
							linkadd="article/"&rszhai("filepath")&"/"&rszhai("HtmUrl")
						else
							linkadd="goto.asp?id="&rszhai("id")
						end if			
						msg=msg&"<td bgcolor="""&Tdbg&""">&nbsp;<a href="""&linkadd&""" target=""_blank"" >"&HTMLEncode(left(rszhai("Title"),titlezs))&"</a></td>"
						rszhai.movenext
						msg=msg&"</tr>"
						rszhai.close
					end if
				i=i+1
				rsv.movenext
				loop
			
		msg=msg&"</tr><td></td></tr>"
		msg=msg&"</table>"
		rsv.close
		response.write msg

End sub


'--------------------------------
'Key_ShowVisitX
'  ãʾУ
'  sortһĿIDTopn , connbz,tdbg Ԫ񱳾,titlezs ,sj,ʱ
'--------------------------------
Sub Key_ShowVisitX(Sort,Topn,connbz,Tdbg,titlezs,sj)


		Msg="<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""1"" cellpadding=""1"">"


		If Sort="00" then
		
				if connbz=1 then
				sql="SELECT top "&Topn&" ZhaiID FROM Key_visit WHERE len(zhaiid)>1 and (NOW() - VisitTime <= "&sj&") GROUP BY ZhaiID ORDER BY COUNT(zhaiid) DESC"
				else
				sql="SELECT top "&Topn&" ZhaiID FROM Key_visit WHERE zhaiid<>'' and ({ fn NOW() } - VisitTime <= "&sj&") GROUP BY ZhaiID ORDER BY COUNT(*) DESC"
				end if
		Else
				if connbz=1 then
				sql="SELECT top "&Topn&" ZhaiID FROM Key_visit WHERE len(zhaiid)>1 and sort='"&sort&"' and (NOW() - VisitTime <= "&sj&") GROUP BY ZhaiID ORDER BY COUNT(zhaiid) DESC"
				else
				sql="SELECT top "&Topn&" ZhaiID FROM Key_visit WHERE zhaiid<>'' and sort='"&sort&"' and ({ fn NOW() } - VisitTime <= "&sj&") GROUP BY ZhaiID ORDER BY COUNT(*) DESC"
				end if

		End if

				set rsv=conn.execute(sql)
				
				i=1
				do while not rsv.eof and i<=topn
					sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,filepath from Key_zhai where ID="&rsv("zhaiid")
					set rszhai=conn.execute(sql)
					if not rszhai.eof then
					
						msg=msg&"<tr height='20'>"
						if isgd=1 then
							linkadd="article/"&rszhai("filepath")&"/"&rszhai("HtmUrl")
						else
							linkadd="goto.asp?id="&rszhai("id")
						end if			
						msg=msg&"<td class=""Td1"" bgcolor="""&Tdbg&""">&nbsp;<a href="""&linkadd&""" target=""_blank"">"&HTMLEncode(left(rszhai("Title"),titlezs))&"</a></td>"
						rszhai.movenext
						msg=msg&"</tr>"
						rszhai.close
					end if
				i=i+1
				rsv.movenext
				loop
			
		msg=msg&"</tr><td></td></tr>"
		msg=msg&"</table>"
		rsv.close
		response.write msg

End sub


'--------------------------------
'Key_ShowSortclass
'  ãʾĿ
'  sort һĿidlistrow 
'--------------------------------
Sub Key_ShowSortclass(sort,listrow)

	Set rs=server.createobject("adodb.recordset")
	Sql="select id,sortid,sortname from Key_Schannel where sortid='"&sort&"'"
	rs.open sql,conn,1,1
	zs=rs.recordcount
	
	Str= "<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""0"" cellpadding=""0"">"
	Str=Str & "<tr>"
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"
	
	for i=1 to zs
	    	Str=Str & "<td class=""Td"" width="""&tdw&""">"
	    	Str=Str & ""
	    	Str=Str & "<b><a target='_blank' class=""link2"" href=""Itemzhai_Class.asp?sort="&sort&"&sortclass="&rs(0)&""">"&rs(2)&"</b></a>"
	    	Str=Str & "</td>"
	    if i mod listrow =0 then 
	       Str=Str & "</tr>"
	    end if
	    rs.movenext
	next
	Str=Str & "</table>"
	rs.close
	response.write Str
End sub

Sub Sortclass(sort)
	
	Set Rs=Conn.Execute("select sortname from Key_Fchannel where sortid='"&sort&"'")
	If Not rs.eof then
		Sortname=Rs(0)
	Else
		Response.write "Բ𣬸Ŀڣ"
		Response.End 
	End if
	Rs.close
	response.write sortname
End Sub

Sub SortSclass(sortclassid)
	If sort="" then exit sub
	Set Rs=Conn.Execute("select sortname from Key_Schannel where id="&sortclassid)
	If Not rs.eof then
		Sortname=Rs(0)
	Else
		Response.write "Բ𣬸Ŀڣ"
		Response.End 
	End if
	Rs.close
	response.write sortname
	
End Sub


'================================================
'CheckInfuse
'  ãֹSQLע
'  str   ----ԭַ
'        strLen  ----ύַ
'================================================
Public Function CheckInfuse(ByVal str, ByVal strLen)
	Dim strUnsafe, arrUnsafe
	Dim i
	
	If Trim(str) = "" Then
		CheckInfuse = ""
		Exit Function
	End If
	str = Left(str, strLen)
	
	On Error Resume Next
	strUnsafe = "'|^|;|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
	If Trim(str) <> "" Then
		If Len(str) > strLen Then
			Response.Write "<Script Language=JavaScript>alert('ȫϵͳʾ\n\nύַƣ');history.back(-1)</Script>"
			CheckInfuse = ""
			Response.End
		End If
		arrUnsafe = Split(strUnsafe, "|")
		For i = 0 To UBound(arrUnsafe)
			If InStr(1, str, arrUnsafe(i), 1) > 0 Then
				Response.Write "<Script Language=JavaScript>alert('ȫϵͳʾ\n\n벻ҪڲаǷַ');history.back(-1)</Script>"
				CheckInfuse = ""
				Response.End
			End If
		Next
	End If
	CheckInfuse = Trim(str)
	Exit Function
	If Err.Number <> 0 Then
		Err.Clear
		Response.Write "<Script Language=JavaScript>alert('ȫϵͳʾ\n\n벻ҪڲаǷַ');history.back(-1)</Script>"
		CheckInfuse = ""
		Response.End
	End If
End Function


'--------------------------------
'Key_ShowSortNewPage
'  ãʾһĿҳ
'  sort,һĿsortclass Ŀid Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,
'        isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowSortNewPage(Sort,Sortclass,Topn,isput,listrow,Tdbg,titlezs,issort,isidate,isuser,isread,Fpxzd,Spxzd,pageadd,pagecs,ispagetb)

	pageno=request("pageno")
	if pageno="" then pageno=1
	If sort="00" then
		Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.Sortclass='"&sortclass&"' and isPub="&ispub&" order by "&Fpxzd&" desc,"&Spxzd&" desc"
	else
		Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.Sort='"&sort&"' and isPub="&ispub&" order by "&Fpxzd&" desc,"&Spxzd&" desc"
	End if
	Set rs=server.createobject("adodb.recordset")
	Rs.open sql,conn,1,1
 
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"	
	Str=""
	Str=Str & "<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"" id=""table268"">"
	
	if not rs.bof and not rs.eof then
	   		rs.pagesize=Topn                        
			rs.absolutepage=pageno 
	    	
	    zjls=rs.pagesize
	        
	    if zjls mod listrow =0 then
		   hs=zjls/listrow
		else
		   hs=round(zjls/listrow+0.6)
		end if
	
	for i=1 to hs
	if rs.eof then exit for
	
				if isgd=1 then
					linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
				else
					linkadd="goto.asp?id="&rs("id")
				end if
	Str=Str & "	<tr>"
			for j=1 to listrow
				Str=Str & "<td bgcolor="&tdbg&" width="&Tdw&" valign=""top"">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank""><span class=""sort"">["&rs("sortname")&"]</span></a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
				Str=Str & "</td>"
				rs.movenext
				if rs.eof then exit for
					if isgd=1 then
						linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
					else
						linkadd="goto.asp?id="&rs("id")
					end if	
			next	
	Str=Str & "	</tr>"
	next

	Str=Str & "	<tr>"
	Str=Str & "		<td width=""928"" valign=""bottom"" align=""center"" colspan="&listrow &">"
	Str=Str & "			<br>"
'---------------------------ҳʼ

				s=pageno-1
				n=pageno+1

					Str=str & "&nbsp;&nbsp;&nbsp;&nbsp;"
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" ><img border=0 src='images/firstPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" >ҳ</a>&nbsp; &nbsp;"
					end if

					if pageno>1 then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" ><img border=0 src='images/prePage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" >һҳ</a>&nbsp; "
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/prePage.gif' width=59 height=23></font>&nbsp; "
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp;"
						end if
					end if
					For i=1 to cint(rs.pagecount)
						If i=int(pageno) then
							str=str & "<font color='red'>" & i & "</font>&nbsp;"
						Else
							str=str & "<a href="&pageadd&".asp?pageno="&i&"&"&pagecs&" >" & i & "&nbsp;"
						End if
					Next
					if cint(rs.pagecount)>cint(pageno) then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" ><img border=0 src='images/nextPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" >һҳ</a>&nbsp; &nbsp;"
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/nextPage.gif' width=59 height=23></font>&nbsp;"
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp; &nbsp;"
						end if
					end if

						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" ><img border=0 src='images/endPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" >βҳ</a>&nbsp; &nbsp;"
						end if
    
					'Str=str & "ҳΣ<font color=#FF0000>"&pageno&"</font>/<font color=#FF0000>"&rs.pagecount&"</font>ҳ&nbsp;"

					Str=str & "<font color=#FF0000>"&rs.pagesize&"</font>  ƪ/ҳ <font color=#FF0000>"&rs.recordcount&"</font>ƪ&nbsp;&nbsp;"               

			
			
			
			'---------------------------ҳ	Str=Str & "		</td>"
	Str=Str & "	</tr>	"
	else
	Str=Str & "	<tr>"
	Str=Str & "		<td width=""928"" valign=""bottom"" align=""center"" colspan="&listrow &"></td>"
	Str=Str & "	</tr>"
	end if	
	Str=Str & "	</table>"
response.write str
End sub


'--------------------------------
'Key_ShowIMgNew
'  ãʾĿ,һĿҲǶĿҳ
'  Topn , isput ,listrow ʾ ,titlezs ,Fpxzd ֶ
'--------------------------------
Sub Key_ShowIMgNew(Topn,isput,listrow,Tdbg,titlezs,Fpxzd)

	Sql="select top "&topn&" ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,img,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and isPub="&ispub&" and img<>'' order by "&Fpxzd&" desc"
	Set rs=server.createobject("adodb.recordset")
	
	rs.open sql,conn,1,1
	zs=rs.recordcount
	Str= "<table cellPadding=""2"" border=""0"" width=""100%"" id=""table1"" cellspacing=""1"" cellpadding=""1"">"
	Str=Str & "<tr>"
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"
	
	for i=1 to zs
		if isgd=1 then
			linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
		else
			linkadd="goto.asp?id="&rs("id")
		end if
	    	Str=Str & "<td bgcolor="""&Tdbg&""" width="""&tdw&""" valign=""top"">"
		    	Str=Str & "<div align=""center"">"
		    	Str=Str & "<table border=""1"" width=""132"" cellspacing=""0"" cellpadding=""0"" style=""border-style: solid; border-width: 0"" height=""84"" bordercolor=""#C3D0D7"" id=""table149"">"
		    	Str=Str & "<tr>"
		    	Str=Str & "<td bgcolor=""#FFFFFF"">"
				Str=Str & "<p align=""center"">"							
				Str=Str & "<a title="""&HTMLEncode(rs("Title"))&""" target=""_blank"" href="""&linkadd&""">"
				Str=Str & "<img src="""&rs("img")&""" border=""0"" width=""130"" height=""90"" vspace=4 hspace=4></a></td>"									
				Str=Str & "</tr>"										
				Str=Str & "</table></div>"		
												
				Str=Str & "<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" id=""table153"">"											
				Str=Str & "<tr>"								
				Str=Str & "<td height=""25"" valign=""bottom"">"							
				Str=Str & "<p align=""center"">"										
				Str=Str & "<a target=""_blank"" href="""&linkadd&""">"									
				Str=Str & left(rs("title"),titlezs)								
				Str=Str & "</a></td>"						
				Str=Str & "</tr></table>"							
	    	Str=Str & "</td>"
	    if i mod listrow =0 then 
	       Str=Str & "</tr>"
	    end if
	    rs.movenext
	next
	Str=Str & "</table>"
	rs.close
	response.write Str
End sub

Sub ShowUserRank()

       response.write "<table width=""100%""  border=""0"" cellspacing=""3"" id=""table256"">"
       sql="select top 15 UserID,count(ID) as Num from key_zhai group by UserID order by count(1) desc,UserID"
       set rs=server.createobject("ADODB.recordset")
       rs.open sql,conn,3
       if not rs.Eof then
         while not rs.Eof 
           Response.Write("<tr>")
           Response.Write("<td class='middletxt'><span class='grayscript'></span><a href='userzhai.asp?ZhaiUser="&rs("UserID")&"'>"&rs("UserID")&"</a> ("&rs("Num")&")</td>")
           Response.Write("<td width='10' class='js'><a href='jsfeed.asp?u="&rs("UserID")&"' target='_blank' title='JSʽ'>JS</a></td>")
           Response.Write("<td width='20' class='rss'><a href='rss2feed.asp?u="&rs("UserID")&"' target='_blank' title='RSSʽ'>RSS</a></td>")
           Response.Write("</tr>")
           rs.MoveNext
         wend
       end if
       rs.close    
       response.write " </table>"
       
End Sub   


Sub ShowTagRank()

       response.write "<table width=""100%""  border=""0"" cellspacing=""3"" id=""table257"">"
       sql="select top 15 xsort from Key_xsort order by hits desc"
       set rs=server.createobject("ADODB.recordset")
       rs.open sql,conn,3
       if not rs.Eof then
       i=1
         while not rs.Eof and i<=15
           Response.Write("<tr>")
           Response.Write("<td class='middletxt'><span class='grayscript'></span><a href='tag.asp?xsort="&rs("xsort")&"'>"&rs("xsort")&"</a></td>")
           Response.Write("<td width='10' class='js'><a href='jsfeed.asp?t="&rs("xsort")&"' target='_blank' title='JSʽ'>JS</a></td>")
           Response.Write("<td width='20' class='rss'><a href='rss2feed.asp?t="&rs("xsort")&"' target='_blank' title='RSSʽ'>RSS</a></td>")
           Response.Write("</tr>")
           rs.MoveNext
           i=i+1
         wend
       end if
       rs.close
       response.write " </table>"
       
End Sub 

'--------------------------------
'Key_ShowImgNewPage
'  ãʾͼƬӣԴĿҳ,֧һĿ
'  sort һĿid Topn , isput ,listrow ʾ ,titlezs ,Fpxzd ֶ,Spxzd ڶֶ
'        pageadd ҳַ,pagecs,ispagetb Ƿʾͼ
'--------------------------------
Sub Key_ShowImgNewPage(sort,Topn,isput,listrow,Tdbg,titlezs,Fpxzd,Spxzd,pageadd,pagecs,ispagetb)

	pageno=request("pageno")
	if pageno="" then pageno=1
	If sort="00" then
		Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,img,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and isPub="&ispub&" and img<>'' order by "&Fpxzd&" desc,"&Spxzd&" desc"
	Else
		Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,img,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.Sort='"&sort&"' and isPub="&ispub&" and img<>'' order by "&Fpxzd&" desc,"&Spxzd&" desc"
	End if
	Set rs=server.createobject("adodb.recordset")
	Rs.open sql,conn,1,1
 
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"	
	Str=""
	Str=Str & "<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"" id=""table268"">"
	
	if not rs.bof and not rs.eof then
	   		rs.pagesize=Topn                        
			rs.absolutepage=pageno 
	    	
	    zjls=rs.pagesize
	        
	    if zjls mod listrow =0 then
		   hs=zjls/listrow
		else
		   hs=round(zjls/listrow+0.6)
		end if
	
	for i=1 to hs
	if rs.eof then exit for
	
				if isgd=1 then
					linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
				else
					linkadd="goto.asp?id="&rs("id")
				end if
	Str=Str & "	<tr>"
			for j=1 to listrow
				Str=Str & "<td bgcolor="&tdbg&" width="&Tdw&" valign=""top"">"
				
		    	Str=Str & "<div align=""center"">"
		    	Str=Str & "<table border=""1"" width=""132"" cellspacing=""0"" cellpadding=""0"" style=""border-style: solid; border-width: 0"" height=""84"" bordercolor=""#C3D0D7"" id=""table149"">"
		    	Str=Str & "<tr>"
		    	Str=Str & "<td bgcolor=""#FFFFFF"">"
				Str=Str & "<p align=""center"">"							
				Str=Str & "<a title="""&HTMLEncode(rs("Title"))&""" target=""_blank"" href="""&linkadd&""">"
				Str=Str & "<img src="""&rs("img")&""" border=""0"" width=""130"" height=""90"" vspace=4 hspace=4></a></td>"									
				Str=Str & "</tr>"										
				Str=Str & "</table></div>"		
												
				Str=Str & "<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0"" id=""table153"">"											
				Str=Str & "<tr>"								
				Str=Str & "<td height=""25"" valign=""bottom"">"							
				Str=Str & "<p align=""center"">"										
				Str=Str & "<a target=""_blank"" href="""&linkadd&""">"									
				Str=Str & left(rs("title"),titlezs)								
				Str=Str & "</a></td>"						
				Str=Str & "</tr></table>"							

				Str=Str & "</td>"
				rs.movenext
				if rs.eof then exit for
					if isgd=1 then
						linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
					else
						linkadd="goto.asp?id="&rs("id")
					end if	
			next	
	Str=Str & "	</tr>"
	next

	Str=Str & "	<tr>"
	Str=Str & "		<td width=""928"" valign=""bottom"" align=""center"" colspan="&listrow &">"
	Str=Str & "			<br>"
'---------------------------ҳʼ

				s=pageno-1
				n=pageno+1

					Str=str & "&nbsp;&nbsp;&nbsp;&nbsp;"
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" ><img border=0 src='images/firstPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" >ҳ</a>&nbsp; &nbsp;"
					end if

					if pageno>1 then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" ><img border=0 src='images/prePage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" >һҳ</a>&nbsp; "
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/prePage.gif' width=59 height=23></font>&nbsp; "
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp;"
						end if
					end if
					'For i=1 to cint(rs.pagecount)
					'	If i=int(pageno) then
					'		str=str & "<font color='red'>" & i & "</font>&nbsp;"
					'	Else
					'		str=str & "<a href="&pageadd&".asp?pageno="&i&"&"&pagecs&" >" & i & "&nbsp;"
					'	End if
					'Next
					if cint(rs.pagecount)>cint(pageno) then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" ><img border=0 src='images/nextPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" >һҳ</a>&nbsp; &nbsp;"
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/nextPage.gif' width=59 height=23></font>&nbsp;"
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp; &nbsp;"
						end if
					end if

						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" ><img border=0 src='images/endPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" >βҳ</a>&nbsp; &nbsp;"
						end if
    
					'Str=str & "ҳΣ<font color=#FF0000>"&pageno&"</font>/<font color=#FF0000>"&rs.pagecount&"</font>ҳ&nbsp;"

					Str=str & "<font color=#FF0000>"&rs.pagesize&"</font>  ƪ/ҳ <font color=#FF0000>"&rs.recordcount&"</font>ƪ&nbsp;&nbsp;"               

			
			
			
			'---------------------------ҳ	Str=Str & "		</td>"
	Str=Str & "	</tr>	"
	else
	Str=Str & "	<tr>"
	Str=Str & "		<td width=""928"" valign=""bottom"" align=""center"" colspan="&listrow &"></td>"
	Str=Str & "	</tr>"
	end if	
	Str=Str & "	</table>"
response.write str
End sub

'--------------------------------
'Key_ShowVipNewPage
'  ãʾVIPԱƼҳ
'  sort һĿid Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,
'        isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowVipNewPage(sort,Topn,isput,listrow,Tdbg,titlezs,issort,isidate,isuser,isread,Fpxzd,Spxzd,pageadd,pagecs,ispagetb)

	pageno=request("pageno")
	if pageno="" then pageno=1
    If sort="00" then
		Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and isPub="&ispub&" and isvip=1 order by "&Fpxzd&" desc,"&Spxzd&" desc"
	Else
		Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.Sort='"&sort&"' and isPub="&ispub&" and isvip=1 order by "&Fpxzd&" desc,"&Spxzd&" desc"
	End if
	Set rs=server.createobject("adodb.recordset")
	Rs.open sql,conn,1,1
 
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"	
	Str=""
	Str=Str & "<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"" id=""table268"">"
	
	if not rs.bof and not rs.eof then
	   		rs.pagesize=Topn                        
			rs.absolutepage=pageno 
	    	
	    zjls=rs.pagesize
	        
	    if zjls mod listrow =0 then
		   hs=zjls/listrow
		else
		   hs=round(zjls/listrow+0.6)
		end if
	
	for i=1 to hs
	if rs.eof then exit for
	
				if isgd=1 then
					linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
				else
					linkadd="goto.asp?id="&rs("id")
				end if
	Str=Str & "	<tr>"
			for j=1 to listrow
				Str=Str & "<td class=""Td"" bgcolor="&tdbg&" width="&Tdw&" valign=""top"">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank""><span class=""sort"">["&rs("sortname")&"]</span></a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
				Str=Str & "</td>"
				rs.movenext
				if rs.eof then exit for
					if isgd=1 then
						linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
					else
						linkadd="goto.asp?id="&rs("id")
					end if	
			next	
	Str=Str & "	</tr>"
	next

	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &">"
	Str=Str & "			<br>"
'---------------------------ҳʼ

				s=pageno-1
				n=pageno+1

					Str=str & "&nbsp;&nbsp;&nbsp;&nbsp;"
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" ><img border=0 src='images/firstPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" >ҳ</a>&nbsp; &nbsp;"
					end if

					if pageno>1 then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" ><img border=0 src='images/prePage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" >һҳ</a>&nbsp; "
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/prePage.gif' width=59 height=23></font>&nbsp; "
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp;"
						end if
					end if
					'For i=1 to cint(rs.pagecount)
					'	If i=int(pageno) then
					'		str=str & "<font color='red'>" & i & "</font>&nbsp;"
					'	Else
					'		str=str & "<a href="&pageadd&".asp?pageno="&i&"&"&pagecs&" >" & i & "&nbsp;"
					'	End if
					'Next
					if cint(rs.pagecount)>cint(pageno) then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" ><img border=0 src='images/nextPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" >һҳ</a>&nbsp; &nbsp;"
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/nextPage.gif' width=59 height=23></font>&nbsp;"
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp; &nbsp;"
						end if
					end if

						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" ><img border=0 src='images/endPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" >βҳ</a>&nbsp; &nbsp;"
						end if
    
					'Str=str & "ҳΣ<font color=#FF0000>"&pageno&"</font>/<font color=#FF0000>"&rs.pagecount&"</font>ҳ&nbsp;"

					Str=str & "<font color=#FF0000>"&rs.pagesize&"</font>  ƪ/ҳ <font color=#FF0000>"&rs.recordcount&"</font>ƪ&nbsp;&nbsp;"               

			
			
			
			'---------------------------ҳ	Str=Str & "		</td>"
	Str=Str & "	</tr>	"
	else
	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &"></td>"
	Str=Str & "	</tr>"
	end if	
	Str=Str & "	</table>"
response.write str
End sub

'--------------------------------
'Key_ShowTagNewPage
'  ãʾǩбҳ
'  xsort һĿid Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,
'        isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowTagNewPage(xsort,Topn,isput,listrow,Tdbg,titlezs,issort,isidate,isuser,isread,Fpxzd,Spxzd,pageadd,pagecs,ispagetb)

	pageno=request("pageno")
	if pageno="" then pageno=1
	Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,xsort,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.xSort='"&xsort&"' and isPub="&ispub&" order by "&Fpxzd&" desc,"&Spxzd&" desc"
	Set rs=server.createobject("adodb.recordset")
	Rs.open sql,conn,1,1
 
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"	
	Str=""
	Str=Str & "<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"" id=""table268"">"
	
	if not rs.bof and not rs.eof then
	   		rs.pagesize=Topn                        
			rs.absolutepage=pageno 
	    	
	    zjls=rs.pagesize
	        
	    if zjls mod listrow =0 then
		   hs=zjls/listrow
		else
		   hs=round(zjls/listrow+0.6)
		end if
	
	for i=1 to hs
	if rs.eof then exit for
	
				if isgd=1 then
					linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
				else
					linkadd="goto.asp?id="&rs("id")
				end if
	Str=Str & "	<tr>"
			for j=1 to listrow
				Str=Str & "<td class=""td"" bgcolor="&tdbg&" width="&Tdw&" valign=""top"">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank"">["&rs("sortname")&"]</a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
				Str=Str & "</td>"
				rs.movenext
				if rs.eof then exit for
					if isgd=1 then
						linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
					else
						linkadd="goto.asp?id="&rs("id")
					end if	
			next	
	Str=Str & "	</tr>"
	next

	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &">"
	Str=Str & "			<br>"
'---------------------------ҳʼ

				s=pageno-1
				n=pageno+1

					Str=str & "&nbsp;&nbsp;&nbsp;&nbsp;"
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" ><img border=0 src='images/firstPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" >ҳ</a>&nbsp; &nbsp;"
					end if

					if pageno>1 then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" ><img border=0 src='images/prePage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" >һҳ</a>&nbsp; "
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/prePage.gif' width=59 height=23></font>&nbsp; "
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp;"
						end if
					end if
					'For i=1 to cint(rs.pagecount)
					'	If i=int(pageno) then
					'		str=str & "<font color='red'>" & i & "</font>&nbsp;"
					'	Else
					'		str=str & "<a href="&pageadd&".asp?pageno="&i&"&"&pagecs&" >" & i & "&nbsp;"
					'	End if
					'Next
					if cint(rs.pagecount)>cint(pageno) then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" ><img border=0 src='images/nextPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" >һҳ</a>&nbsp; &nbsp;"
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/nextPage.gif' width=59 height=23></font>&nbsp;"
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp; &nbsp;"
						end if
					end if

						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" ><img border=0 src='images/endPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" >βҳ</a>&nbsp; &nbsp;"
						end if
    
					'Str=str & "ҳΣ<font color=#FF0000>"&pageno&"</font>/<font color=#FF0000>"&rs.pagecount&"</font>ҳ&nbsp;"

					Str=str & "<font color=#FF0000>"&rs.pagesize&"</font>  ƪ/ҳ <font color=#FF0000>"&rs.recordcount&"</font>ƪ&nbsp;&nbsp;"               

			
			
			
			'---------------------------ҳ	Str=Str & "		</td>"
	Str=Str & "	</tr>	"
	else
	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &"></td>"
	Str=Str & "	</tr>"
	end if	
	Str=Str & "	</table>"
response.write str
End sub


'--------------------------------
'Key_ShowUserNewPage
'  ãʾûղбҳ
'  zhaiuser ûid Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,
'        isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowUserNewPage(zhaiuser,Topn,isput,listrow,Tdbg,titlezs,issort,isidate,isuser,isread,Fpxzd,Spxzd,pageadd,pagecs,ispagetb)

	pageno=request("pageno")
	if pageno="" then pageno=1
	Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,xsort,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.userid='"&zhaiuser&"' and isPub="&ispub&" order by "&Fpxzd&" desc,"&Spxzd&" desc"
	Set rs=server.createobject("adodb.recordset")
	Rs.open sql,conn,1,1
 
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"	
	Str=""
	Str=Str & "<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"" id=""table268"">"
	
	if not rs.bof and not rs.eof then
	   		rs.pagesize=Topn                        
			rs.absolutepage=pageno 
	    	
	    zjls=rs.pagesize
	        
	    if zjls mod listrow =0 then
		   hs=zjls/listrow
		else
		   hs=round(zjls/listrow+0.6)
		end if
	
	for i=1 to hs
	if rs.eof then exit for
	
				if isgd=1 then
					linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
				else
					linkadd="goto.asp?id="&rs("id")
				end if
	Str=Str & "	<tr>"
			for j=1 to listrow
				Str=Str & "<td class=""td"" bgcolor="&tdbg&" width="&Tdw&" valign=""top"">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank"">["&rs("sortname")&"]</a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
				Str=Str & "</td>"
				rs.movenext
				if rs.eof then exit for
					if isgd=1 then
						linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
					else
						linkadd="goto.asp?id="&rs("id")
					end if	
			next	
	Str=Str & "	</tr>"
	next

	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &">"
	Str=Str & "			<br>"
'---------------------------ҳʼ

				s=pageno-1
				n=pageno+1

					Str=str & "&nbsp;&nbsp;&nbsp;&nbsp;"
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" ><img border=0 src='images/firstPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" >ҳ</a>&nbsp; &nbsp;"
					end if

					if pageno>1 then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" ><img border=0 src='images/prePage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" >һҳ</a>&nbsp; "
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/prePage.gif' width=59 height=23></font>&nbsp; "
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp;"
						end if
					end if
					'For i=1 to cint(rs.pagecount)
					'	If i=int(pageno) then
					'		str=str & "<font color='red'>" & i & "</font>&nbsp;"
					'	Else
					'		str=str & "<a href="&pageadd&".asp?pageno="&i&"&"&pagecs&" >" & i & "&nbsp;"
					'	End if
					'Next
					if cint(rs.pagecount)>cint(pageno) then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" ><img border=0 src='images/nextPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" >һҳ</a>&nbsp; &nbsp;"
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/nextPage.gif' width=59 height=23></font>&nbsp;"
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp; &nbsp;"
						end if
					end if

						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" ><img border=0 src='images/endPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" >βҳ</a>&nbsp; &nbsp;"
						end if
    
					'Str=str & "ҳΣ<font color=#FF0000>"&pageno&"</font>/<font color=#FF0000>"&rs.pagecount&"</font>ҳ&nbsp;"

					Str=str & "<font color=#FF0000>"&rs.pagesize&"</font>  ƪ/ҳ <font color=#FF0000>"&rs.recordcount&"</font>ƪ&nbsp;&nbsp;"               

			
			
			
			'---------------------------ҳ	Str=Str & "		</td>"
	Str=Str & "	</tr>	"
	else
	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &"></td>"
	Str=Str & "	</tr>"
	end if	
	Str=Str & "	</table>"
response.write str
End sub

'--------------------------------
'Key_ShowVipNewPage
'  ãʾVIPԱƼҳ
'  sort һĿid Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,
'        isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowVipNewPage(sort,Topn,isput,listrow,Tdbg,titlezs,issort,isidate,isuser,isread,Fpxzd,Spxzd,pageadd,pagecs,ispagetb)

	pageno=request("pageno")
	if pageno="" then pageno=1
    If sort="00" then
		Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and isPub="&ispub&" and isvip=1 order by "&Fpxzd&" desc,"&Spxzd&" desc"
	Else
		Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.Sort='"&sort&"' and isPub="&ispub&" and isvip=1 order by "&Fpxzd&" desc,"&Spxzd&" desc"
	End if
 
	Set rs=server.createobject("adodb.recordset")
	Rs.open sql,conn,1,1
 
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"	
	Str=""
	Str=Str & "<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"" id=""table268"">"
	
	if not rs.bof and not rs.eof then
	   		rs.pagesize=Topn                        
			rs.absolutepage=pageno 
	    	
	    zjls=rs.pagesize
	        
	    if zjls mod listrow =0 then
		   hs=zjls/listrow
		else
		   hs=round(zjls/listrow+0.6)
		end if
	
	for i=1 to hs
	if rs.eof then exit for
	
				if isgd=1 then
					linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
				else
					linkadd="goto.asp?id="&rs("id")
				end if
	Str=Str & "	<tr>"
			for j=1 to listrow
				Str=Str & "<td class=""Td"" bgcolor="&tdbg&" width="&Tdw&" valign=""top"">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank""><span class=""sort"">["&rs("sortname")&"]</span></a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
				Str=Str & "</td>"
				rs.movenext
				if rs.eof then exit for
					if isgd=1 then
						linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
					else
						linkadd="goto.asp?id="&rs("id")
					end if	
			next	
	Str=Str & "	</tr>"
	next

	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &">"
	Str=Str & "			<br>"
'---------------------------ҳʼ

				s=pageno-1
				n=pageno+1

					Str=str & "&nbsp;&nbsp;&nbsp;&nbsp;"
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" ><img border=0 src='images/firstPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" >ҳ</a>&nbsp; &nbsp;"
					end if

					if pageno>1 then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" ><img border=0 src='images/prePage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" >һҳ</a>&nbsp; "
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/prePage.gif' width=59 height=23></font>&nbsp; "
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp;"
						end if
					end if
					'For i=1 to cint(rs.pagecount)
					'	If i=int(pageno) then
					'		str=str & "<font color='red'>" & i & "</font>&nbsp;"
					'	Else
					'		str=str & "<a href="&pageadd&".asp?pageno="&i&"&"&pagecs&" >" & i & "&nbsp;"
					'	End if
					'Next
					if cint(rs.pagecount)>cint(pageno) then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" ><img border=0 src='images/nextPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" >һҳ</a>&nbsp; &nbsp;"
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/nextPage.gif' width=59 height=23></font>&nbsp;"
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp; &nbsp;"
						end if
					end if

						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" ><img border=0 src='images/endPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" >βҳ</a>&nbsp; &nbsp;"
						end if
    
					'Str=str & "ҳΣ<font color=#FF0000>"&pageno&"</font>/<font color=#FF0000>"&rs.pagecount&"</font>ҳ&nbsp;"

					Str=str & "<font color=#FF0000>"&rs.pagesize&"</font>  ƪ/ҳ <font color=#FF0000>"&rs.recordcount&"</font>ƪ&nbsp;&nbsp;"               

			
			
			
			'---------------------------ҳ	Str=Str & "		</td>"
	Str=Str & "	</tr>	"
	else
	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &"></td>"
	Str=Str & "	</tr>"
	end if	
	Str=Str & "	</table>"
response.write str
End sub

'--------------------------------
'Key_ShowTagNewPage
'  ãʾǩбҳ
'  xsort һĿid Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,
'        isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowTagNewPage(xsort,Topn,isput,listrow,Tdbg,titlezs,issort,isidate,isuser,isread,Fpxzd,Spxzd,pageadd,pagecs,ispagetb)

	pageno=request("pageno")
	if pageno="" then pageno=1
	Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,xsort,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and a.xSort='"&xsort&"' and isPub="&ispub&" order by "&Fpxzd&" desc,"&Spxzd&" desc"
	Set rs=server.createobject("adodb.recordset")
	Rs.open sql,conn,1,1
 
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"	
	Str=""
	Str=Str & "<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"" id=""table268"">"
	
	if not rs.bof and not rs.eof then
	   		rs.pagesize=Topn                        
			rs.absolutepage=pageno 
	    	
	    zjls=rs.pagesize
	        
	    if zjls mod listrow =0 then
		   hs=zjls/listrow
		else
		   hs=round(zjls/listrow+0.6)
		end if
	
	for i=1 to hs
	if rs.eof then exit for
	
				if isgd=1 then
					linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
				else
					linkadd="goto.asp?id="&rs("id")
				end if
	Str=Str & "	<tr>"
			for j=1 to listrow
				Str=Str & "<td class=""td"" bgcolor="&tdbg&" width="&Tdw&" valign=""top"">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank"">["&rs("sortname")&"]</a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
				Str=Str & "</td>"
				rs.movenext
				if rs.eof then exit for
					if isgd=1 then
						linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
					else
						linkadd="goto.asp?id="&rs("id")
					end if	
			next	
	Str=Str & "	</tr>"
	next

	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &">"
	Str=Str & "			<br>"
'---------------------------ҳʼ

				s=pageno-1
				n=pageno+1

					Str=str & "&nbsp;&nbsp;&nbsp;&nbsp;"
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" ><img border=0 src='images/firstPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" >ҳ</a>&nbsp; &nbsp;"
					end if

					if pageno>1 then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" ><img border=0 src='images/prePage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" >һҳ</a>&nbsp; "
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/prePage.gif' width=59 height=23></font>&nbsp; "
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp;"
						end if
					end if
					'For i=1 to cint(rs.pagecount)
					'	If i=int(pageno) then
					'		str=str & "<font color='red'>" & i & "</font>&nbsp;"
					'	Else
					'		str=str & "<a href="&pageadd&".asp?pageno="&i&"&"&pagecs&" >" & i & "&nbsp;"
					'	End if
					'Next
					if cint(rs.pagecount)>cint(pageno) then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" ><img border=0 src='images/nextPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" >һҳ</a>&nbsp; &nbsp;"
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/nextPage.gif' width=59 height=23></font>&nbsp;"
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp; &nbsp;"
						end if
					end if

						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" ><img border=0 src='images/endPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" >βҳ</a>&nbsp; &nbsp;"
						end if
    
					'Str=str & "ҳΣ<font color=#FF0000>"&pageno&"</font>/<font color=#FF0000>"&rs.pagecount&"</font>ҳ&nbsp;"

					Str=str & "<font color=#FF0000>"&rs.pagesize&"</font>  ƪ/ҳ <font color=#FF0000>"&rs.recordcount&"</font>ƪ&nbsp;&nbsp;"               

			
			
			
			'---------------------------ҳ	Str=Str & "		</td>"
	Str=Str & "	</tr>	"
	else
	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &"></td>"
	Str=Str & "	</tr>"
	end if	
	Str=Str & "	</table>"
response.write str
End sub


'--------------------------------
'Key_ShowZtNewPage
'  ãĳרݣҳ
'  ztid רid Topn , isput ,listrow ʾ ,titlezs ,issort,ǷʾĿ,isidate Ƿʾʱ,
'        isuserǷʾղû,isreadǷʾ㼴,Fpxzd ֶ,Spxzd ڶֶ
'--------------------------------
Sub Key_ShowZtNewPage(ztid,Topn,isput,listrow,Tdbg,titlezs,issort,isidate,isuser,isread,Fpxzd,Spxzd,pageadd,pagecs,ispagetb)

	pageno=request("pageno")
	if pageno="" then pageno=1
	Sql="select ID,Title,UserID,PostTime,FromURL,HtmUrl,hot,ztid,isvip,reads,filepath,xsort,a.Sort,b.SortName,b.Sortid from key_zhai a,Key_Fchannel b where a.Sort=b.SortID and ztid="&ztid&" and isPub="&ispub&" order by "&Fpxzd&" desc,"&Spxzd&" desc"
	Set rs=server.createobject("adodb.recordset")
	Rs.open sql,conn,1,1
 
	Tdw=int((100/listrow))
	Tdw=Tdw&"%"	
	Str=""
	Str=Str & "<table border=""0"" width=""100%"" cellspacing=""1"" cellpadding=""1"" id=""table268"">"
	
	if not rs.bof and not rs.eof then
	   		rs.pagesize=Topn                        
			rs.absolutepage=pageno 
	    	
	    zjls=rs.pagesize
	        
	    if zjls mod listrow =0 then
		   hs=zjls/listrow
		else
		   hs=round(zjls/listrow+0.6)
		end if
	
	for i=1 to hs
	if rs.eof then exit for
	
				if isgd=1 then
					linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
				else
					linkadd="goto.asp?id="&rs("id")
				end if
	Str=Str & "	<tr>"
			for j=1 to listrow
				Str=Str & "<td class=""td"" bgcolor="&tdbg&" width="&Tdw&" valign=""top"">"
	    	Str=Str & ""
		    	If issort=1 then
			    	Str=Str & "<a href=""itemzhai.asp?sortid="&rs("sortid")&""" target=""_blank"">["&rs("sortname")&"]</a>&nbsp;"
		    	End if
	    	Str=Str & "<a href="""&linkadd&""" target=""_blank"">"&Left(rs("title"),titlezs)&"</a>"
		    	If isidate=1 then
			    	A=split(rs("PostTime"),"-")
			    	Str=Str & "&nbsp;<span class=""idate"">["&a(1)&"."&trim(left(a(2),2))&"]</span>"
		    	End if
		    	If isuser=1 then 
				    Str=Str & "<span class='grayscript'>&nbsp;(<a href='userzhai.asp?zhaiuser="&rs("userid")&"'>"&rs("userid")&"</a>&nbsp;ղ)&nbsp;"
				End if
				If isread=1 then
					Str=Str & "&nbsp;<font color=#800000>("&rs("reads")&")</font>"
				End if
				Str=Str & "</td>"
				rs.movenext
				if rs.eof then exit for
					if isgd=1 then
						linkadd="article/"&rs("filepath")&"/"&rs("HtmUrl")
					else
						linkadd="goto.asp?id="&rs("id")
					end if	
			next	
	Str=Str & "	</tr>"
	next

	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &">"
	Str=Str & "			<br>"
'---------------------------ҳʼ

				s=pageno-1
				n=pageno+1

					Str=str & "&nbsp;&nbsp;&nbsp;&nbsp;"
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" ><img border=0 src='images/firstPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno=1&"&pagecs&" >ҳ</a>&nbsp; &nbsp;"
					end if

					if pageno>1 then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" ><img border=0 src='images/prePage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&s&"&"&pagecs&" >һҳ</a>&nbsp; "
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/prePage.gif' width=59 height=23></font>&nbsp; "
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp;"
						end if
					end if
					'For i=1 to cint(rs.pagecount)
					'	If i=int(pageno) then
					'		str=str & "<font color='red'>" & i & "</font>&nbsp;"
					'	Else
					'		str=str & "<a href="&pageadd&".asp?pageno="&i&"&"&pagecs&" >" & i & "&nbsp;"
					'	End if
					'Next
					if cint(rs.pagecount)>cint(pageno) then
						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" ><img border=0 src='images/nextPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&n&"&"&pagecs&" >һҳ</a>&nbsp; &nbsp;"
						end if
					else
						if ispagetb=1 then
							Str=str & "<font color=#C0C0C0><img border=0 src='images/nextPage.gif' width=59 height=23></font>&nbsp;"
						else
							Str=str & "<font color=#C0C0C0>һҳ</font>&nbsp; &nbsp;"
						end if
					end if

						if ispagetb=1 then
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" ><img border=0 src='images/endPage.gif' width=59 height=23></a>&nbsp;"
						else
							Str=str & "<a href="&pageadd&".asp?pageno="&rs.pagecount&"&"&pagecs&" >βҳ</a>&nbsp; &nbsp;"
						end if
    
					'Str=str & "ҳΣ<font color=#FF0000>"&pageno&"</font>/<font color=#FF0000>"&rs.pagecount&"</font>ҳ&nbsp;"

					Str=str & "<font color=#FF0000>"&rs.pagesize&"</font>  ƪ/ҳ <font color=#FF0000>"&rs.recordcount&"</font>ƪ&nbsp;&nbsp;"               

			
			
			
			'---------------------------ҳ	Str=Str & "		</td>"
	Str=Str & "	</tr>	"
	else
	Str=Str & "	<tr>"
	Str=Str & "		<td width=""100%"" valign=""bottom"" align=""center"" colspan="&listrow &"></td>"
	Str=Str & "	</tr>"
	end if	
	Str=Str & "	</table>"
response.write str
End sub

'-------------------------------------
' Key_ShowSo
'-------------------------------------
Sub Key_ShowSo()
Str=""
Str=str & "<table id='table308' width='100%'>"
Str=str & "		  <form method='POST' action='so.asp'>"
Str=str & "			<tr>"
Str=str & "				<td align='middle' style='font-size: 14px; line-height: 22px' height='28'>"
Str=str & "				<p align='left'>"
Str=str & "				<input id='tag' maxLength='38' size='19' name='tag'> "
Str=str & "			  </td>"
Str=str & "				<td align='left' style='font-size: 14px; line-height: 22px' height='28'>"
Str=str & "			  <input name='sub1' type='image' src='images/Search1.gif' onClick='return check();'></td>"
Str=str & "				<td align='left' style='font-size: 14px; line-height: 22px' height='28'>"
Str=str & "			  				<input id='sc' type='radio' value='all' name='tj' checked><label for='sc'></label><input id='hy' type='radio' value='user' name='tj'><label for='hy'>û</label>"
Str=str & "							<input id='all' type='radio' value='bq' name='tj'><label for='all'><font color='#ff6600'>ǩ</font></label>"
Str=str & "							</td>"
Str=str & "			</tr>"
Str=str & "			</form>"			
Str=str & "			</table>"
Response.write Str
End Sub
%>



